import axios from "@/utils/request";

export function addStudent(params){
    return axios({
        method:"post",
        url:"/student",
        data:params
    })
}

export function deleteStudent(params){
    return axios({
        method:"delete",
        url:"/student",
        data:params
    })
}

export function updateStudent(params){
    return axios({
        method:"put",
        url:"/student",
        data:params
    })
}

export function selectStudent(params){
    return axios({
        method:"get",
        url:"/student",
        params: {
            pageNum:params.pageNum,
            pageSize:params.pageSize,
            search:params.search,
        }
    })
}

export function loginStudent(params){
    return axios({
        method:"post",
        url:"/student/login",
        data: params
    })
}

export function logoutStudent(params){
    return axios({
        method:"post",
        url:"/student/logout",
        data: params
    })
}

export function batchResetPsw(params){
    return axios({
        method:"post",
        url:"/student/batchResetPsw",
        data: params
    })
}

export function batchDelete(params){
    return axios({
        method:"post",
        url:"/student/batchDelete",
        data: params
    })
}

export function exportData(params){
    return axios({
        method:"get",
        url:"/student/exportData",
        params: {
            search:params.search
        }
    })
}

export function importData(params){
    return axios({
        method:"post",
        url:"/student/importData",
        data: params
    })
}

export function studentCount(params){
    return axios({
        method:"get",
        url:"/student/studentCount",
        params: params
    })
}

export function getRatioOfMW(params){
    return axios({
        method:"get",
        url:"/student/ratioOfMW",
        params: params
    })
}

export function getRatioOfMajor(params){
    return axios({
        method:"get",
        url:"/student/ratioOfMajor",
        params: params
    })
}

export function queryStudentListByClass(params){
    return axios({
        method:"post",
        url:"/student/queryStudentListByClass",
        data: params
    })
}